Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hdr] Compute the center exposure of the hdr automatically #1315

Merged
merged 18 commits into from
Feb 14, 2023

Conversation

demoulinv
Copy link
Contributor

@demoulinv demoulinv commented Dec 12, 2022

Use samples in calibration node to determine the reference exposure for each grouped views. Write results in a text file in the same directory as the response file. In the merge node, read the file containing the reference indexes and use them to compute the HDR image.

Description

In the calibration node, for all exposure levels of each group of views, the mean, max an min values of luminance are computed from all the mean rgb info contained in the loaded image samples. For each group of views, the index of the reference image is deduced from those stats. The average of those computed indexes is written in a text file located in the same directory as the response file already delivered by the node.
In the merging node, the file is read and the index is used to build the HDR image. A parameter is still there to overide the automaticaly set ref images if needed.

Features list

Implementation remarks

src/software/pipeline/main_LdrToHdrCalibration.cpp Outdated Show resolved Hide resolved
src/software/pipeline/main_LdrToHdrCalibration.cpp Outdated Show resolved Hide resolved
src/software/pipeline/main_LdrToHdrCalibration.cpp Outdated Show resolved Hide resolved
src/software/pipeline/main_LdrToHdrMerge.cpp Outdated Show resolved Hide resolved
src/software/pipeline/main_LdrToHdrMerge.cpp Outdated Show resolved Hide resolved
@fabiencastan fabiencastan added this to the 2.5.0 milestone Dec 23, 2022
@fabiencastan fabiencastan changed the title HDR image computation update [hdr] Compute the center exposure of the hdr automatically Jan 5, 2023
Copy link
Member

@fabiencastan fabiencastan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix byPass option.

Use samples in calibration node to determine the reference exposure for each grouped views. Write results in a text file in the same directory as the response file.
In the merge node, read the file containing the reference indexes and use them to compute the HDR image.
…ode refactoring.

LdrToHdrMerging: Use offsetRefBracketIndex parameter if it is in a suitable range regarding the number of views in a group. If not, use the indexes computed in the calibration node.
demoulinv and others added 10 commits January 24, 2023 10:35
merging: take bypass mode into account
calibration: compute a ref index for final exposure in linear mode
code simplification

Co-authored-by: Fabien Castan <[email protected]>
Remove useless ofstream closing
Compute reference index for merging within the merging node after reading luminance statistics provided by the calibration node through a text file.
Manage bypass mode by computing luminance statistics from images at the calibration stage.
Adjust the targeted luminance level for the output HDR image in case of non sRGB working space.
Code adjustment and cleaning.
Add bypass and calibrationMethod as parameters of sampling.cpp.
Move calibration method definition in brackets.hpp.
Redispatch luminance statistics computation between sampling and calib.
Create a simplified sampling mode.
Update luminance statistics file format.
make sure the luminance stat curve is monotonic before searching the best exposure.
Accept unaligned exposures between poses.
Add origin viewID in image samples.
Remove monotonicity check of the mean luminance curve. Such a check is done for every poses when the luminance statistic file is built.
Comment on lines +443 to +451
double exposureMin = 1e9;
for (auto it = v_luminanceInfos[i].begin(); it != v_luminanceInfos[i].end(); it++)
{
if ((it->second).exposure < exposureMin)
{
exposureMin = (it->second).exposure;
srcIdWithMinimalExposure = it->first;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to sort the data before file export.

@fabiencastan fabiencastan merged commit d2ddcfa into develop Feb 14, 2023
@fabiencastan fabiencastan deleted the dev/hdrMerge_autoRefLevel branch February 14, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants